<meta http-equiv="Pragma" content="no-cache">

<img style="width: 640px; height: 480px;" id="webcam" alt="webcam" src="webcam.jpg" onload="ok()" onerror="ok()" onabort="ok()"> 

<script language="javascript">
bool = false;

function ok() 
{ 
   bool = true;
}

function timer()
{ 
   if (bool) 
   {  
      bool = false;  
      rand = Math.random(); 
      document.getElementById('webcam').src = "webcam.jpg?" + rand; 
   } 
   setTimeout("timer()", 50);
}

timer();
</script> 